package day4;


/**
 *
 * 子类不会获取父类的构造器  子类构造器可以调用父类构造器的代码用super
 *
 * 通过super调用父类
 */

class BaseClass2{
    public int a=5;
}


public class SubClass extends BaseClass2 {

    public int a = 7;

    public void accessOwner(){
        System.out.println(a);
    }

    public void accessBase(){
        System.out.println(super.a);
    }

    public void run(){
        SubClass sc = new SubClass();
        sc.accessOwner();
        sc.accessBase();
    }


}
